package com.me.chat.mq.sender;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Service;

import javax.jms.Topic;

/**
 * @Author: qiu
 * @Date: 2021/4/1 15:06
 */

@Service
public class WsChatSender {

    @Autowired
    private JmsMessagingTemplate jmsMessagingTemplate;


    @Autowired
    @Qualifier("wsChatTopic")
    private Topic wsChatTopic;


    public void sender(String json) {

        jmsMessagingTemplate.convertAndSend(wsChatTopic, json);
    }

}
